package
{
	import flash.events.FocusEvent;
	
	import mx.controls.TextArea;
	import mx.events.FlexEvent;

	public class SilverTextArea extends TextArea
	{
		public function SilverTextArea()
		{ 
			super();
			this.addEventListener(FlexEvent.CREATION_COMPLETE,  onCreationComplete);
			this.addEventListener(FocusEvent.FOCUS_OUT ,  onFocusOut);      
		}
		
        /**  
         * CREATION_COMPLETE EVENT
         * @param event    
         */
        private function onCreationComplete(event:FlexEvent):void 
        {
            this.removeEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete);
            this.textField.alwaysShowSelection = true;
        }
        
        /**
         * FOCUS_OUT
         * @param event
         */
        private function onFocusOut(e:FocusEvent ):void
        {
            this.setSelection(0,0);
        } 		
	}
}